-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Remove use of pk_can_do()
#10505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
valeriosetti
wants to merge
8
commits into
Mbed-TLS:development
Choose a base branch
from
valeriosetti:issue10453
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Remove use of pk_can_do()
#10505
+57
−23
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caab40b to
ad4f7b3
Compare
ad4f7b3 to
562619f
Compare
562619f to
9620a90
Compare
c8b2c7e to
0a6589e
Compare
The check being removed is already done few lines above so there is no need to repeat it twice. Signed-off-by: Valerio Setti <[email protected]>
Add a simple helper to convert from PK sigalg to PSA algorithm. This is handy when calling mbedtls_pk_can_do_psa() knowing the PK sigalg and the used MD type. This is being added in a separate file because it's meant to be consumed by both ssl and x509 modules. It was not added to tf-psa-crypto because this is only needed on the mbedtls repo and doing so reduce interdependencies between the repos. Signed-off-by: Valerio Setti <[email protected]>
Signed-off-by: Valerio Setti <[email protected]>
Checking that parent PK type is OK is definitely faster than computing an hash, so invert the checks. Signed-off-by: Valerio Setti <[email protected]>
Signed-off-by: Valerio Setti <[email protected]>
Signed-off-by: Valerio Setti <[email protected]>
…pe() Signed-off-by: Valerio Setti <[email protected]>
0a6589e to
9eb5b2a
Compare
bjwtaylor
reviewed
Dec 5, 2025
library/ssl_tls.c
Outdated
| #if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ | ||
| defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) | ||
| if (ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 && | ||
| mbedtls_pk_can_do(&chain->pk, MBEDTLS_PK_ECKEY)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we still need this usage?
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, nope, that completely missed my checks :(
Signed-off-by: Valerio Setti <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs-review
Every commit must be reviewed by at least two team members,
needs-reviewer
This PR needs someone to pick it up for review
priority-high
High priority - will be reviewed soon
size-s
Estimated task size: small (~2d)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves #10453
PR checklist